﻿
@using PagedList;
@using PagedList.Mvc
@model IPagedList<SILAS.Entidades.Empleado>

@{
    ViewBag.Title = "ListarEmpleados";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section css{

<link href="@Url.Content("~/Content/PagedList.css")" rel="stylesheet" type="text/css" />

}
<h2>Gestión de Empleados</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
      
        <th>
            Nombre
        </th>
        <th>
            ApPaterno
        </th>
        <th>
            ApMaterno
        </th>
        <th>
            DNI
        </th>
        <th>
            Area
        </th>
        <th>
            Email
        </th>
        <th>
            Celular
        </th>
        <th>
            Cargo
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id}) |
            @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
           
            
        </td>
        
        <td>
            @item.Nombre
        </td>
        <td>
            @item.ApPaterno
        </td>
        <td>
            @item.ApMaterno
        </td>
        <td>
            @item.DNI
        </td>
        <td>
            @item.Area
        </td>
        <td>
            @item.Email
        </td>
        <td>
            @item.Celular
        </td>
        <td>
            @item.Cargo.Descripcion
        </td>
    </tr>
}

</table>
<div>
    @Html.PagedListPager(Model, page => Url.Action("ListarEmpleados", new { page })) 
</div>
